#ifndef __DTU_CONFIG_H__
#define __DTU_CONFIG_H__
#include "string.h"
#include <stdint.h>

#define NET_TCP              1
#define NET_UDP              2
#define RADIO_TYPE_LORA      1
#define RADIO_TYPE_NB_COAP   2
#define RADIO_TYPE_NB_SOCKET 3
#define RADIO_TYPE_WIFI      4
#define RADIO_TYPE_GPRS      5
//0==NoDaDt  1==DaDt
#define DADT 1
//0==Single 1==merge
#define MERGE 1
//5==none cmdID 7==cmdID
#define CMD_PRE_LEN 7
//NB send random delay. at least 2. unit:s. (NB_SEND_DELAY-2,NB_SEND_DELAY+2)
#define NB_SEND_DELAY 10

typedef struct
{
    uint8_t  IP1;
    uint8_t  IP2;
    uint8_t  IP3;
    uint8_t  IP4;
    uint16_t Port;
    uint8_t  PSM;
    uint8_t  eDRX;
} NBInfoType;

typedef struct
{
    uint8_t  IP1;
    uint8_t  IP2;
    uint8_t  IP3;
    uint8_t  IP4;
    uint16_t Port;
    uint8_t  Net;
} NBTCPInfoType;

typedef struct
{
    uint8_t Type; //ÉäÆµÄ£¿éÀàÐÍ LoRa - 1, NB - 2, NBTCP=3, WIFI=4
    union {
        NBInfoType    NB;
        NBTCPInfoType NBTCP;
    } Paras;
} RadioInfoType;

extern RadioInfoType RadioCfgInfo;
#endif
